home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 139 / cd-rom 139.iso / capa / mcoder / MediaCoder-0.5.1-r3.exe / htdocs / load / helper.js < prev    next >
Encoding:
Text File  |  2006-11-19  |  605 b   |  28 lines

  1. var ready = true;
  2. var url = document.location.href;
  3. var origWidth = window.innerWidth;
  4. var origHeight = window.innerHeight;
  5.  
  6. function GetToken(str, token)
  7. {
  8.     var idx = str.indexOf(token + '=');
  9.     if (idx <= 0) return null;
  10.     var argstr = str.substring(idx + token.length + 1);
  11.     idx = argstr.indexOf('&');
  12.     return idx >=0 ? argstr.substring(0, idx) : argstr;
  13. }
  14.  
  15. function onUnload()
  16. {
  17.     window.innerWidth = origWidth;
  18.     window.innerHeight = origHeight;
  19. }
  20.  
  21. function launch(redirect)
  22. {
  23.     if (ready) {
  24.         window.location = "/setup/savedata?launch=1&url=" + redirect;
  25.         ready = false;
  26.     }
  27. }
  28.